<template>
  <!-- 指标集：左右结构 -->
  <div class="card-list">
    <div v-for="(item, i) in cardList" :key="i" class="card-item">
      <div class="card-item-left">
        <div class="card-item-left-icon">
        </div>
      </div>

      <div>
        <div class="mb-4px">{{ item.label }}</div>
        <div>
          <span class="text-24px font-bold">{{ item.value }}</span>
          <span class="ml-5px pb-2px">{{ item.unit }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
interface CardItem {
  label: string
  value: string | number
  unit?: string
}

interface Props {
  cardList: CardItem[]
}

withDefaults(defineProps<Props>(), {
  cardList: () => []
})
</script>

<style lang="scss" scoped>
.card-list {
  display: flex;
}

.card-item {
  display: flex;
  align-items: center;

  & + .card-item {
    margin-left: 20px;
  }
}

.card-item-left {
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-item-right {
  padding-top: 5px;
  padding-left: 5px;
}

.card-item-left-icon {
  width: 80px;
  height: 80px;
  position: relative;

  &::before {
    content: '';
    width: 100%;
    height: 100%;
    background: url("/imgs/business/visual-dark/circle-1-1.png");
    background-size: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    animation: rotate1 3s infinite linear;
  }

  &::after {
    content: '';
    width: 80%;
    height: 80%;
    background: url("/imgs/business/visual-dark/circle-1-2.png");
    background-size: 100%;
    display: block;
    position: absolute;
    top: 10%;
    left: 10%;
    animation: rotate2 3s infinite linear;
  }
}

@keyframes rotate1 {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes rotate2 {
  100% {
    transform: rotate(-360deg);
  }
}
</style>
